package com.activenetwork.smlite.testcase.login;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;

import com.activenetwork.smlite.page.LoginErrorPage;
import com.activenetwork.smlite.testcase.BaseCase;
import com.activenetwork.util.EnvContext;
import com.activenetwork.util.PageLoader;
import com.activenetwork.util.RandomString;
import com.activenetwork.util.verification.gson.FailurePoint;

public class Login007 extends BaseCase {
	static final Logger logger = LoggerFactory.getLogger(Login007.class);
	
	@Test
	public void Password_text_input_field_length_validation(){
		
		String pwd = RandomString.generateRandomString(50);
		loginBusiness.login("Tester", pwd);
		LoginErrorPage loginErrorPage = PageLoader.load(LoginErrorPage.class);
		
		
		if(!StringUtils.equalsIgnoreCase(loginErrorPage.getErrorMsg(), "Username or Password is not correct.")){
			EnvContext.failurePointTL.get().add(new FailurePoint(
					Login007.class.getName(), 
					"Verify user password is length", 
					"User password length failed. Not Correct."));
		}
		
		loginBusiness.logout();
	}
	
	

}
